<?php
 
namespace app\admin\validate;
use think\Validate; 

class Course extends Validate{
    // 验证规则
    protected $rule = [
        ['name', 'require|unique:course,name^teacher', '课程名称必须填写|课程重复'],
        ['duration', 'require', '课时时间必须填写'],
    ];  

}